#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int i = 0;
	int n = 0;
	int ret = 1;
	int j = 1;
	int sum = 0;

	printf("请输入n：");
	scanf("%d", &n);
	/*for (j = 1; j <= n; j++)
	{
		ret = 1;    //初始化ret的值为1.
		for (i = 1; i <= n; i++)
		{
			ret *= i;
		}
		sum += ret;
	}*/
	
	for (i = 1; i <= n; i++)
	{
		ret *= i;
		sum += ret;
	}
	printf("n的阶乘是：%d\n", ret);
	printf("前n项的阶乘的和是：%d\n", sum);

	return 0;
}